package com.bancomer.pig.functions;

import java.util.Calendar;

public class CompareDates {
	public static int compareDates(String startDate, String endDate){
		int result = 0;
		try {
	       	 Calendar calendarStartDate=Calendar.getInstance();
	       	 calendarStartDate.set(Integer.valueOf(startDate.split("-")[0]), Integer.valueOf(startDate.split("-")[1]), Integer.valueOf(startDate.split("-")[2]),0,0,0);
	       	 Calendar calendarEndtDate=Calendar.getInstance();
	       	 calendarEndtDate.set(Integer.valueOf(endDate.split("-")[0]), Integer.valueOf(endDate.split("-")[1]), Integer.valueOf(endDate.split("-")[2]),0,0,0);
	       	 result = calendarStartDate.compareTo(calendarEndtDate);
		} catch (Exception ee) {
	         throw ee;
	    }
		return result;
	}
}
